const fs = require('fs');
const path = require('path');

const routerArray = [];

fs
  .readdirSync(__dirname + '/modules')
  .filter(file => {
    return (
      file.indexOf('.') !== 0 &&
      file.slice(-3) === '.js' &&
      file.indexOf('.test.js') === -1
    );
  })
  .forEach(file => {
    const router = require(path.join(__dirname,'modules',  file));
    routerArray.push(router);
  });

module.exports = routerArray;
